#! /bin/bash
#$ -q 1-day
#$ -l h_vmem=10G
#$ -t 1-581:1
#$ -l loc2tmp=1G
#$ -M prodduturi.naresh@mayo.edu
#$ -m a
#$ -V
#$ -cwd
#$ -e /data4/bsi/bioinf_ext2/s109990/m081429_mesa/FINAL_MERGING/temp/HIS/impute_logfiles_sungrid
#$ -o /data4/bsi/bioinf_ext2/s109990/m081429_mesa/FINAL_MERGING/temp/HIS/impute_logfiles_sungrid
#$ -notify
date
tmp=/local2/tmp/m081429/`expr $RANDOM \* $RANDOM`
cleanup () {
/bin/rm -rf $tmp
}
trap 'cleanup' USR1 USR2 EXIT
mkdir -p $tmp
cd $tmp
t1=`pwd`
t2=`uname -n`
t3="$t1 $t2"
echo $t3 >> /data4/bsi/bioinf_ext2/s109990/m081429_mesa/FINAL_MERGING/temp/HIS/impute_system
k=`cat  /data4/bsi/bioinf_ext2/s109990/m081429_mesa/FINAL_MERGING/temp/HIS/ArrayJob_file_impute |head -$SGE_TASK_ID |tail -1`
/data2/bsi/RandD/Arraybased_RND/Easy_imputer_test/impute_temp/TRANSH/console/impute_v2.3.0_x86_64_static/impute2 $k -seed 123456789 

gzip impute_out_*
wait
k1=`cat  /data4/bsi/bioinf_ext2/s109990/m081429_mesa/FINAL_MERGING/temp/HIS/Gunzip_file_impute |head -$SGE_TASK_ID |tail -1`
mv impute_out_*.gz $k1
rm -rf $tmp
echo $SGE_TASK_ID >>/data4/bsi/bioinf_ext2/s109990/m081429_mesa/FINAL_MERGING/temp/HIS/impute_check_jobs

date
